import Vue from 'vue'

import Cookies from 'js-cookie'

import Element from 'element-ui'
import './assets/styles/element-variables.scss'// element-ui 主题颜色css


import '@/assets/styles/common.scss' // 公共 css
import App from './App'
import store from './store'
import router from './router'
import plugins from './plugins' // plugins
import GLOBAL from "@/utils/global";//引用全局变量
import tips from '@/components/Tips/index.js'
import Loading from '@/components/Loading/index.js'

import './assets/icons' // icon
import "./assets/images/iconmoon/iconfont.css"//阿里自己创建对应项目图标
import './permission' // 权限控制



import {
  get_duration,
  objHeavy,
  replaceEmpty,
  replaceDot,
  parseTime,
  rand,
  getNowTime,
  getNowDate,
  dateAddDays,
  getInputFocus,
  showLogoUrl,
  timestampFormat,
  resetForm,
  all_hide,
  formatDate,
  get_date_str,
  get_today_yesterday,
  money_thousand,
  accAdd,
  accSub,
  accMul,
  accDiv,
  dataURLToBlob,
  get_file_name,
  getCookie,
  setCookie,
  getBrowser,
  addMonth,
  num_show,
  amount_count,
  cardno_show,
  compare,
  get_days_between,
  input_lengt_,
  tips_show,
  go_back,
  nav_change_show,
  throttle,
  LoadingShowHide,
} from '@/utils/common'

// 全局方法挂载
Vue.prototype.get_duration = get_duration;
Vue.prototype.objHeavy = objHeavy;
Vue.prototype.replaceEmpty = replaceEmpty;
Vue.prototype.replaceDot = replaceDot;
Vue.prototype.parseTime = parseTime;
Vue.prototype.rand = rand;
Vue.prototype.getNowTime = getNowTime;
Vue.prototype.getNowDate = getNowDate;
Vue.prototype.dateAddDays = dateAddDays;
Vue.prototype.getInputFocus = getInputFocus;
Vue.prototype.showLogoUrl = showLogoUrl;
Vue.prototype.timestampFormat = timestampFormat;
Vue.prototype.resetForm = resetForm;
Vue.prototype.all_hide = all_hide;
Vue.prototype.formatDate = formatDate;
Vue.prototype.get_date_str = get_date_str;
Vue.prototype.get_today_yesterday = get_today_yesterday;
Vue.prototype.money_thousand = money_thousand;
Vue.prototype.accAdd = accAdd;
Vue.prototype.accSub = accSub;
Vue.prototype.accMul = accMul;
Vue.prototype.accDiv = accDiv;
Vue.prototype.dataURLToBlob = dataURLToBlob;
Vue.prototype.get_file_name = get_file_name;
Vue.prototype.getCookie = getCookie;
Vue.prototype.setCookie = setCookie;
Vue.prototype.getBrowser = getBrowser;
Vue.prototype.myBrowser = getBrowser;
Vue.prototype.addMonth = addMonth;
Vue.prototype.num_show = num_show;
Vue.prototype.amount_count = amount_count;
Vue.prototype.global = GLOBAL;
Vue.prototype.cardno_show = cardno_show;
Vue.prototype.compare = compare;
Vue.prototype.get_days_between = get_days_between;
Vue.prototype.input_lengt_ = input_lengt_;
Vue.prototype.tips_show = tips_show;
Vue.prototype.go_back = go_back;
Vue.prototype.nav_change_show = nav_change_show;
Vue.prototype.throttle = throttle;
Vue.prototype.LoadingShowHide = LoadingShowHide;

// 全局组件挂载
Vue.use(plugins);
Vue.use(tips);
Vue.use(Loading);

/**
 * If you don't want to use mock-server
 * you want to use MockJs for mock api
 * you can execute: mockXHR()
 *
 * Currently MockJs will be used in the production environment,
 * please remove it before going online! ! !
 */

Vue.use(Element, {
  size: Cookies.get('size') || 'medium' // set element-ui default size
});
//阻止 vue 在启动时生成生产提示
Vue.config.productionTip = false;
// console.log(process.env.VUE_APP_BASE_API, '环境');
// console.log(process.env.NODE_ENV);

new Vue({
  el: '#app',
  router,
  store,
  render: h => h(App),
})

